from selenium import webdriver

def get_driver():
    '''获得浏览器驱动对象'''
    chromedriver = 'chromedriver'
    driver = webdriver.Chrome(executable_path=chromedriver)
    # 隐式等待
    driver.implicitly_wait(30)
    return driver

def main():
    url = 'https://appstoreconnect.apple.com/login'
    driver = get_driver()
    driver.get(url)
    # 切入iframe标签
    driver.switch_to.frame(driver.find_element_by_id('aid-auth-widget-iFrame'))
    # 向 Apple ID输入框中填入内容
    driver.find_element_by_id('account_name_text_field').send_keys('123456')
    # 切出iframe
    driver.switch_to.parent_frame()

main()